<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改地图管理')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-esmap-edit" th:object="${sysEsmap}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">地图ID：</label>
                <div class="col-sm-8">
                    <input name="mapId" th:field="*{mapId}" class="form-control" type="text">
                </div>
            </div>
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">地图文件上传：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input type="file" name="folder" multiple webkitdirectory>-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">建筑token：</label>
                <div class="col-sm-8">
                    <input name="token" th:field="*{token}" class="form-control" type="text">
                </div>
            </div>
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">地图数据位置：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="mapDataUrl" th:field="*{mapDataUrl}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->

<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">地图主题位置：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="mapThemeUrl" th:field="*{mapThemeUrl}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">样式ID：</label>
                <div class="col-sm-8">
                    <input name="themeId" th:field="*{themeId}" class="form-control" type="text">
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">中心点坐标：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="centerCoordinate" th:field="*{centerCoordinate}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/esmap";
        $("#form-esmap-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-esmap-edit').serialize());
                // uploadFile();
            }
        }
        function uploadFile() {
            var formData = new FormData();
            // if ($('#folder')[0].files[0] == null) {
            //     $.modal.alertWarning("请先选择文件路径");
            //     return false;
            // }
            formData.append('folder', $("#folder").val());
            $.ajax({
                url: prefix + "/edit",
                type: 'post',
                cache: false,
                data: formData,
                processData: false,
                contentType: false,
                dataType: "json",
                success: function(result) {
                    $.operate.successCallback(result);
                }
            });
        }
    </script>
</body>
</html>